package com.softer.wxzj.controller;

import com.github.pagehelper.PageInfo;
import com.softer.wxzj.common.entity.CommonResult;
import com.softer.wxzj.common.entity.Page;
import com.softer.wxzj.entity.RecoverResidual;
import com.softer.wxzj.service.RecoverResidualService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * RecoverResidualController class(残值回收)
 *
 * @author ljm
 * @date 2019/7/16
 */
@RestController
@RequestMapping("/recoverResidual")
@Slf4j
public class RecoverResidualController {

    @Autowired
    RecoverResidualService recoverResidualService;

    @RequestMapping("/getInfo")
    public PageInfo<RecoverResidual> getRecoverResidual(Page page, String id) {
        return recoverResidualService.selectByPrimaryKey(page,id);
    }

    @RequestMapping("/add")
    public CommonResult addRecoverResidual(RecoverResidual recover) {

        return recoverResidualService.insertSelective(recover);
    }

}
